import React, { useEffect, useState } from 'react'
import { Button, SearchBar, Space, Toast } from 'antd-mobile'
import axios from '../../api/index'
import { ProductCard, Tag } from 'react-vant';
function index() {
  const [list, setList] = useState([])
  const getData = async () => {
    const resp = await axios.get('/list')
    console.log(resp);
    setList(resp.data.data)
  }
  useEffect(() => {
    getData()
  }, [])
  return (
    <div>
      <SearchBar placeholder='请输入内容' />
      {
        list.map((v, i) => {
          return <ProductCard
          key={i}
            num={v.id}
            price={v.price}
            desc={v.date}
            title={v.title}
            thumb={v.image}
          />
        })
      }
    </div>
  )
}

export default index